
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nft_shop/my/page/set/my_aboutus_page.dart';
import 'package:nft_shop/my/page/set/my_loghistory_page.dart';
import 'package:nft_shop/my/page/set/my_traders_password_page.dart';
import 'package:nft_shop/res/global.dart';
import 'package:nft_shop/widgets/load_image.dart';
import 'package:nft_shop/widgets/my_app_bar.dart';
import 'package:nft_shop/widgets/my_scroll_view.dart';

class MySafetyPage extends StatefulWidget {
  const MySafetyPage({Key? key}) : super(key: key);

  @override
  _MySafetyPageState createState() => _MySafetyPageState();
}

class _MySafetyPageState extends State<MySafetyPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        centerTitle: "安全中心",
      ),
      body: MyScrollView(
        children: [
          setItemWidget("修改登录密码",onPressed: () =>Get.to(MyTradersPasswordPage())),
          setItemWidget("登录设备管理",onPressed: () => Get.to(MyLogHistoryPage())),
        ],
      ),
    );
  }

  //itemCell
  Widget setItemWidget(String title,{GestureTapCallback? onPressed,String? describe}){
    return InkWell(
      onTap: onPressed,
      child: Container(
        margin: EdgeInsets.only(left: 16),
        padding: EdgeInsets.only(top: 20,bottom: 20,right: 16),
        decoration: BoxDecoration(
            border: Border(
              bottom: Divider.createBorderSide(context,
                  color: Global.kTheme.colorLine, width: 1),
            )
        ),
        child: Row(
          children: [
            Text(title,style: TextStyle(fontSize: 14,color: Global.kTheme.textPrimary6,fontFamily: Global.myRegularFont),),
            Spacer(),
            LoadAssetImage("next_icon",width: 7,height: 12,)
          ],
        ),
      ),
    );
  }
}

